//
//  OfficeLeaveTableViewCell.swift
//  EduManage
//
//  Created by design02 on 16/12/23.
//  Copyright © 2016年 wsl. All rights reserved.
//

import UIKit

class OfficeLeaveTableViewCell: UITableViewCell {

    var userTx: UIImageView!
    var userName: UILabel!
    var countLabel: UILabel!
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupViews()
    }
    
    func setupViews() {
        
        userTx = UIImageView.init(frame: CGRect(x: 20, y: 10, width: 40, height: 40))
        userTx.layer.cornerRadius = 20
        userTx.layer.masksToBounds = true
        
        userName = UILabel.init(frame: CGRect(x: userTx.frame.maxX + 10, y: 10, width: 100, height: 40))
        userName.textColor = textlight
        userName.font = UIFont.systemFont(ofSize: 16)
        
//        let countLabelX = userName.frame.maxX + 30
//        let countLabelY: CGFloat = 10.0
//        let countLabelW = (screenW - countLabelX - 20)/2
//        let countLabelH: CGFloat = 40.0
        
        countLabel = UILabel.init(frame: CGRect(x: screenW-240, y: 10, width: 200, height: 40))
        countLabel.textColor = textlight
        countLabel.font = UIFont.systemFont(ofSize: 16)
        countLabel.textAlignment = NSTextAlignment.right

        
        self.contentView.addSubview(userTx)
        self.contentView.addSubview(userName)
        self.contentView.addSubview(countLabel)

    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
